<%@page import="controller.AdminRequestHelper"%>
<%
    String content = (String) request.getAttribute(AdminRequestHelper.contentParameterName);
    String operation = (String) request.getAttribute(AdminRequestHelper.operationParameterName);
%>


<div class="adminmenu">
    <a href="admin.jsp?content=order">Order list</a>
    <a href="admin.jsp?content=product">Catalog</a>
    <a href="admin.jsp?content=warehouse">Warehouses</a>
    <a href="admin.jsp?content=popularityreport">Popularity Report</a>
    <a href="admin.jsp?content=orderreport">Order Report</a>
</div>

<div id="options"> 
    <%
        if ("order".equals(content)) {
            if ("view".equals(operation)) {

    %>

    <input type="button" class="adminButton" value="Ship" id="ship_btn" />
    <input type="button" class="adminButton" value="Cancel" id="cancel_btn" />  
    <%     }
        }
        if ("product".equals(content)) {
            if (operation == null) {
    %>
    <input type="button" class="adminButton" value="Create" id='create_commodity_btn'
           onclick="window.location.replace('admin.jsp?content=<%= content%>&operation=create');" />
    <input type="button" class="adminButton" value="Delete" id='delete_commodity_btn'/>
    <%
            }
            if ("create".equals(operation)) {
    %>
    <input type="button" class="adminButton" value="Save" id="save_created" />
    <input type="button" class="adminButton" value="Cancel" onclick="window.location.replace('admin.jsp?content=<%= content%>');" />
    <%
            }
            if ("edit".equals(operation)) {
    %>
    <input type="button" class="adminButton" value="Save" id="save_edited" />
    <input type="button" class="adminButton" value="Cancel" onclick="window.location.replace('admin.jsp?content=<%= content%>');" />
    <%
            }
        }
        if ("warehouse".equals(content)) {

    %>   
    <%
        }
        if ("popularityreport".equals(content)) {
    %>    
            <input type="button" class="adminButton" value="Export to Excel" onclick="exportPopularityReport()" />
    <%
        }
    %>
    <%
        if ("orderreport".equals(content)) {
    %>    
            <input type="button" class="adminButton" value="Export to Excel" onclick="exportOrderReport()" />
    <%
        }
    %>
    
</div>

